package com.goingup.domain;


public abstract class Request {

	
	protected abstract void executeRequest(Elevator elevator);
	
	private boolean executed=false;
	private Floor floor;
	
	public Request(Floor floor){
		this.floor=floor;
	}
	public boolean wasExecuted()
	{
		return executed;
	}
	
	public void executed()
	{
		this.executed=true;
	}
	public void execute(Elevator elevator)
	{
		if (wasExecuted())
			return;
		executeRequest(elevator);
		executed();
	}
	
	public Floor getFloor() {
		return floor;
	}
}
